package com.lebron.kotlin.ui.present.impl

import com.lebron.kotlin.bean.movie.Subject
import com.lebron.kotlin.http.ApiCompleteListener
import com.lebron.kotlin.ui.model.impl.MovieDetailModelImpl
import com.lebron.kotlin.ui.present.MovieDetailPresentI
import com.lebron.kotlin.ui.view.MovieDetailView

/**
 * @Author lebron
 * @Date 18-8-2-上午9:54
 */
class MovieDetailPresentImpl : BasePresentImpl<MovieDetailView>(), MovieDetailPresentI, ApiCompleteListener<Subject, Any> {
    override fun onFailed(error: String) {
        view?.onError(error)
    }

    private val movieDetailModel = MovieDetailModelImpl(this)


    override fun onSuccess(b: Any) {
    }

    override fun onComplete(t: Subject) {
        checkNet()
        view?.setMovieSubject(t)
    }


    override fun getMovieDetail(id: String) {
        movieDetailModel.getMovieSubject(id)
    }

}